﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepCultivation.API.AddliCation.BreedingD;
using SheepCultivation.Common.Domain.Week2;
using SheepCultivation.Common.Dto;
using SheepCultivation.Enum;

namespace SheepCultivation.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class BreedingsController : ControllerBase
    {
        public readonly IMediator mediator;

        public BreedingsController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        #region 羊只称重新增
        /// <summary>
        /// 羊只称重新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepWeighedAdds")]
        public async Task<Result> Handle(SheepWeighedCreateCommon requestn)
        {
            return await mediator.Send(requestn);
        }
        #endregion

        #region 羊只称重显示
        /// <summary>
        /// 羊只称重 显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepWeighedLists")]
        public async Task<Result> Handle(SheepWeighedSeachCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 品种新增
        /// <summary>
        /// 品种新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepvarietyAdd")]
        public async Task<Result> Handle(SheepvarietyCreateCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 下拉框 品种
        /// <summary>
        /// 下拉框 品种
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepvarietyBind")]
        public async Task<Result> Handle(SheepvarietySeachCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 体尺测定新增
        /// <summary>
        /// 体尺测定新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("BodyAdds")]
        public async Task<Result> Handle(BodyCreateCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 体尺测定显示
        /// <summary>
        /// 体尺测定显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("BodyLists")]
        public async Task<Result> Handle(BodySeachCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 品相测定新增
        /// <summary>
        /// 品相测定新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("AppearancesAdds")]
        public async Task<Result> Handle(AppearancesCreateCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

        #region 品相测定显示
        /// <summary>
        /// 品相测定显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("AppearancesLists")]
        public async Task<Result> Handle(AppearancesSeachCommon request)
        {
            return await mediator.Send(request);
        }
        #endregion

    }
}
